package com.example.springmvcinterview.understandAOP;

import org.springframework.aop.support.DefaultPointcutAdvisor;
import org.springframework.aop.support.annotation.AnnotationMatchingPointcut;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author : 叶荻风
 * @create : 2024/12/18 15:34
 */
@Configuration
public class AspectConfig {

    @Bean
    public UserServiceAspect userServiceAspect() {
        return new UserServiceAspect();
    }


    @Bean
    public DefaultPointcutAdvisor advisor() {
        AnnotationMatchingPointcut pointcut = new AnnotationMatchingPointcut(null, Show.class);
        return new DefaultPointcutAdvisor(pointcut, userServiceAspect());
    }



}
